BUG: serialize numpy SeedSequence for sensor seeds (#1087) - #1124
Merged
Gui-FernandesBR merged 2 commits intoAug 15, 2026
Merged
Conversation
Gui-FernandesBR
force-pushed
the
bug/1087-sensor-seedsequence-serialize
branch
from
August 11, 2026 01:48
c586fd2 to
118d866
Compare
Gui-FernandesBR
approved these changes
Aug 11, 2026
Gui-FernandesBR
force-pushed
the
bug/1087-sensor-seedsequence-serialize
branch
from
August 15, 2026 01:50
118d866 to
34679a2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1124 +/- ##
========================================
Coverage 84.33% 84.33%
========================================
Files 130 130
Lines 17258 17266 +8
========================================
+ Hits 14554 14562 +8
Misses 2704 2704 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Gui-FernandesBR
force-pushed
the
bug/1087-sensor-seedsequence-serialize
branch
from
August 15, 2026 02:28
34679a2 to
ee699b6
Compare
The SeedSequence branch pushed object_hook to 26 statements, one over pylint's max-statements, failing the Linters job. Extract the Flight rebuild into a module-level helper next to set_minimal_flight_attributes, matching how that path is already factored. Pure code move. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RocketPyEncoder/RocketPyDecoderto round-tripnumpy.random.SeedSequencevia its reconstructible state (entropy,spawn_key,n_children_spawned,pool_size) plus a class signature.TypeError: Object of type SeedSequence is not JSON serializablewhen dumping sensors (or any object) that hold aSeedSequenceseed, including spawned child sequences used for parallel Monte Carlo.Fixes #1087
Test plan
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=. pytest -p pytest_cov tests/unit/sensors/test_sensor_seeding.py -q(8 passed)Accelerometer(..., seed=SeedSequence(0).spawn(1)[0])thenjson.dumps(sensor.to_dict(), cls=RocketPyEncoder)succeeds and decoder restores matching.state